﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp
{
    public partial class Form15 : Form
    {
        public Form15()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str = "server=localhost;userid=root;password=root;database=mysql";
            MySqlConnection mySqlConnection=new MySqlConnection(str);
            mySqlConnection.Open();
            MessageBox.Show("数据库连接成功! ");
        }

        private void Form15_Load(object sender, EventArgs e)
        {

        }
    }
}
